import useProjectConfig from "@/hooks/useProjectConfig.ts";
import {getAppInfo} from "@/services/usercenter.ts";

/**
 * 登录后跳转到后台配置首页
 * @author Finn Yu
 * @since 2023/7/5 13:54
 */
const Welcome = () => {
    //如果存在默认首页，跳转
    const projectConfig = useProjectConfig();
    if (projectConfig?.recordVO?.pcHomePageUrl) {
        // window.location.href = projectConfig?.recordVO?.pcHomePageUrl;
        window.location.href = '/';
        return;
    } else {
        getAppInfo().then((res: any) => {
            if (res?.recordVO?.pcHomePageUrl) {
                window.location.href = '/';
                // window.location.href = res?.recordVO?.pcHomePageUrl;
            }
        })
    }

    return <>欢迎登录</>;
};
export default Welcome;
